package com.yeban.javase.day07.test3_stringbuilder;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/10/15
 *
 * 练习2：利用StringBuilder完成字符串反转
 */
public class Test04 {

    public static void main(String[] args) {

        StringBuilder sb = new StringBuilder("aaabbbcccajsa");
        System.out.println("翻转前sb：" + sb);

        String reverseStr = sb.reverse().toString();    // 在执行reverse的时候，它本身就改变了
        System.out.println("翻转后sb：" + sb);
        System.out.println("翻转后reverseStr：" + reverseStr);

    }
}
